home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-05-07 | 1.2 KB | 33 lines | [TEXT/DWat] |
- % Asymptote demo #1
- % Plot a basic linear graph of y=x^2 with error bars
-
- graphunits in % Use inches to measure page coordinates
- graphframe 2 7 2 7 % Set the location of the graph on the page
- fontname Times % Change to the Times font for the graph
-
- % Calculate y = x*x for x = 1 to 25
- npts 25 % We will calculate 25 points
- rpn index >x % Put 1,2,3,4...25 into the x vector
- rpn <x <x * >y % Find the square of the x vector
- rpn 50 >e % Put a constant error of 50 into the e vector
-
- graphlimits % Set the graph limits to show all of the points
- graphticks % Choose the tick spacing automatically
- drawframe % Draw the frame around the graph
- scale 1.5 % Make the scale factor bigger and draw the axis labels
- drawtitle Linear Graph with Error Bars
- drawxlabel X axis
- drawylabel Y axis
-
- pointsymbol 4 filled % Choose filled squares for the point symbols
- scale 1.5 % Draw big points
- plotpoints
- scale 1 % Set the scale factor back
- pensize 1 % Set up to draw 1 point thick line
- plotline % Plot the line
- pensize .25 % Set up for hairlines
- ploterrors bottom % Draw error bars on the bottom of the points
- ploterrors top % Draw error bars on top
-
- fullscreen
- showgraph